<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');
?>
<?php load::into('head'); ?>
<form action="<?php echo url::mpf('link','link','modify'); ?>" method="post" enctype="multipart/form-data">
<section class="main table">
  <aside>
    <div>
      <div class="head">
        <a class="button green" easy width="880" height="580" url="<?php echo url::mpf('link','link','edit'); ?>">
          <em class="fa fa-plus"></em>
          <font>添加友链</font>
        </a>
      </div>
      <table>
        <tbody>
          <tr>
            <th>选择</th>
            <th>排序</th>
            <th>标题</th>
            <th>链接</th>
            <th>换链</th>
            <th>类型</th>
            <th>图片</th>
            <th>显示</th>
            <th>操作</th>
          </tr>
          <?php
          foreach($data['list'] as $v){
          ?>
          <tr>
            <td width="48"><?php echo form::checkbox('id',null,null,array($v['id']=>null)); ?></td>
            <td width="58"><?php echo form::input("sort{$v['id']}",$v['sort'],null,'text',null); ?></td>
            <td><?php echo $v['name']; ?></td>
            <td grey><?php echo $v['link']; ?></td>
            <td width="108" exchange="<?php echo $v['id']; ?>">-</td>
            <td width="88" grey><?php echo $G['option']['link'][$v['type']]; ?></td>
            <td width="88" grey><?php if($v['type']){ ?><img check src="<?php echo url::upload($v['image']); ?>" width="60" height="30" /><?php } ?></td>
            <td width="88"><?php echo form::radio("display{$v['id']}",$v['display'],1,$G['option']['is'],array('color'=>'green','post'=>'{"id[]":"'.$v['id'].'"}','url'=>url::mpf('link','link','modify'))); ?></td>
            <td width="155">
              <a class="btnfa black" easy width="880" height="580" name="修改友链" url="<?php echo url::mpf('link','link','edit',array('id'=>$v['id'])); ?>">
                <em class="fa fa-pencil" title="修改"></em>
              </a>
              <a class="btnfa red delete" url="<?php echo url::mpf('link','link','delete',array('id'=>$v['id'])); ?>">
                <em class="fa fa-trash-o" title="删除"></em>
              </a>
            </td>
          </tr>
          <?php
          }
          ?>
        </tbody>
      </table>
    </div>
  </aside>
</section>

<section class="refer">
  <?php echo html::admpages($data['pages'],$data['total']); ?>
  <p>
    <a class="button green  checkall">
      <em class="fa fa-square"></em>
      <font>全选</font>
    </a>
    <a class="button green tfa nocheckall">
      <em class="fa fa-square-o"></em>
      <font>取消</font>
    </a>
    <button class="button green" type="submit">
      <em class="fa fa-sort"></em>
      <font>排序</font>
    </button>
    <a class="button red tfa delcheck" url="<?php echo url::mpf('link','link','delete'); ?>">
      <em class="fa fa-trash-o"></em>
      <font>删除</font>
    </a>
  </p>
</section> 
</form>
<?php load::into('foot'); ?>